<html>
  <head>
    <title>审票复核任务列表</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="style/css.css" rel="stylesheet" type="text/css" />
	<link href="../../css/general1.css" rel="stylesheet" type="text/css" />
	<link href="../../zephyr/css/paginator.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../script/hiawardbpm.js"></script>
    <script type="text/javascript" src="../../script/prototype.js"></script>
    <script type="text/javascript" src="/vchzms-hiaward/dwr/engine.js"> </script>
	<script type="text/javascript" src="/vchzms-hiaward/dwr/util.js"> </script>
    <script type="text/javascript" src="/vchzms-hiaward/dwr/interface/Dao.js"></script>
	<script type="text/javascript" src="../../zephyr/js/Pager.js"></script>
  </head>
  <body>
    <div id="content"></div>
	<div id="pagingBar"></div>
    <button onclick="getTaskByUser('auditverify')" class="btn1">获取一笔审票复核任务</button>
    <script type="text/javascript">
    var rowSize = 20;
	var rowNum = 1;
	var totalResults;
	
	/**
     * 显示table元素
     * @param {Object} pageNum 页数
     * @param {Object} pageSize 每页大小
     */
	function showTable(pageNum,pageSize) {
		
		var pagination = new Object();
		pagination.currentPages = pageNum;
		pagination.pageSize = pageSize;
		
		var voucher=new Object();
		voucher.chkstate=3;
		
		Dao.getVoucherData(voucher,pagination,function(data){
			var con = "<table width='900' border='0' cellspacing='0' cellpadding='0' class='tablist1'><tr><td class='title2'>" + 
			  	"<span>记账失败任务列表</span></td></tr></table><table width='900' border='0' cellspacing='0' cellpadding='0' class='tablist1'><tr></tr><tr><th><span>帐号</span></th>" + 
					"<th><span>金额</span></th><th><span>凭证号</span></th><th><span>交换号</span></th></tr>";	
			for(var i=0;i<data.results.length;i++){
				con+="<tr><td>"+data.results[i].accno+"</td><td>"+data.results[i].amount+"</td><td>"+data.results[i].vchno+"</td><td>"+data.results[i].exchno+"</td></tr>";
			}
			con+="</table>";
			document.getElementById('content').innerHTML=con;
			
			totalResults = data.totalResults;
			var pages = totalResults/rowSize;	
			if(pages > parseInt(pages)) {
				pages = parseInt(pages) + 1;
			}else {
				pages = parseInt(pages);
			}
			RenderPager(totalResults,pageNum,rowSize,pages,"pagingBar");
		});
	}
	
	showTable(rowNum,rowSize);
   </script>
  </body>
</html>
